import validator from '../index.js';
export class IndexForm_rules {
  constructor() {
    this.name = [
      { required: true, message: '道馆名称不能为空', trigger: 'blur' }
    ];
    this.linkman = [
      { required: true, message: '道馆联系人不能为空', trigger: 'blur' }
    ];
    this.imagePath = [
      { required: true, message: '图片不能为空', trigger: 'blur' }
    ];
    this.title = [
      { required: true, message: '内容标题不能为空', trigger: 'blur' }
    ];
    this.content = [
      { required: true, message: '内容不能为空', trigger: 'blur' }
    ];
    this.linkPhoneNumber = [
      { required: true, message: '手机号码不能为空', trigger: 'blur' },
      {
        validator(rule, value, callback) {
          callback(validator.checkPhone(value, '手机号码格式错误'));
        },
        trigger: 'blur'
      }
    ];
    this.parentTAProvinceCode = [
      validator.required('请选择省市区')
    ];
    this.address = [
      { required: true, message: '详细地址不能为空', trigger: 'blur' }
    ];
  }
}
// 师资力量-教练
export class CreatCoach_rules {
  constructor() {
    this.name = [
      { required: true, message: '教练姓名不能为空', trigger: 'blur' }
    ];
    this.level = [
      { required: true, message: '教练级别不能为空', trigger: 'blur' }
    ];
    this.imagePath = [
      { required: true, message: '教练头像不能为空', trigger: 'blur' }
    ];
    this.height = [
      { required: true, message: '身高不能为空', trigger: 'blur' }
      // { pattern: /^0.([1-9]|d[1-9])$|^[1-9]d{0,8}.d{0,2}$|^[1-9]d{0,8}$/, message: '请输入大于0的数' }
    ];
    this.weight = [
      { required: true, message: '体重不能为空', trigger: 'blur' }
      // { pattern: /^0.([1-9]|d[1-9])$|^[1-9]d{0,8}.d{0,2}$|^[1-9]d{0,8}$/, message: '请输入大于0的数' }
    ];
    this.age = [
      { required: true, message: '年龄不能为空', trigger: 'blur' }
      // { pattern: /^\+?[1-9]\d*$/, message: '请输入大于0的正整数' }
    ];
    this.eventName = [
      { required: true, message: '运动项目不能为空', trigger: 'blur' }
    ];
    this.nationality = [
      { required: true, message: '国际不能为空', trigger: 'change' }
    ];
    this.experienced = [
      { required: true, message: '运动生涯不能为空', trigger: 'blur' }
    ];
  }
}
// 新建课程
export class CreatCourse_rules {
  constructor() {
    this.name = [
      { required: true, message: '道馆名称不能为空', trigger: 'blur' }
    ];
    this.type = [
      { required: true, message: '课程类型不能为空', trigger: 'blur' }
    ];
    this.imagePath = [
      { required: true, message: '图片不能为空', trigger: 'blur' }
    ];
    this.entryDes = [
      { required: true, message: '报名条件不能为空', trigger: 'blur' }
    ];
    this.description = [
      { required: true, message: '课程介绍不能少于10个字', min: 10, trigger: 'blur' }
    ];
  }
}
// 新建学员
export class CreatStu_rules {
  constructor() {
    this.name = [
      { required: true, message: '姓名不能为空', trigger: 'blur' }
    ];
    this.genderCode = [
      { required: true, message: '性别不能为空', trigger: 'change' }
    ];
    this.imagePath = [
      { required: true, message: '头像不能为空', trigger: 'blur' }
    ];
    this.age = [
      { required: true, message: '年龄不能为空', trigger: 'blur' }
    ];
    this.description = [
      { required: true, message: '课程介绍不能为空', trigger: 'blur' }
    ];
  }
}
